The possible impact of weather on crimes in Amsterdam#

import pandas as pd
from pandas import Timedelta
import numpy as np
import plotly.express as px
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from IPython.display import display, Markdown
import plotly.io as pio
pio.renderers.default = "notebook"
import plotly.graph_objects as go
df = pd.read_csv("merged_weather_misdrijven_monthly_v3.csv")

Perspective 1: Pleasant weather increases the risk of certain crimes#

Argument 1.1 Higher temperatures lead to more bicycle theft#

In Amsterdam, cycling is the main form of transport. Better weather conditions encourage more outside activity such as events or going to the beach, which means more transport and bikes being left outside. This should be the optimal climate for bicycle theft and supports the idea that weather has an influence on crime. To look into this relationship between theft and tropical weather, we inspect temperature and the rates of bicycle theft in the graph below.

df.columns = df.columns.str.strip()
df['TX'] = df['TX'] / 10  # TX is in tienden van °C
df['TG'] = df['TG'] / 10  # TG is in tienden van °C
display(Markdown("### Bicycle Theft vs. Maximum Temperature"))
display(Markdown("_Slight increase in thefts when it's warmer._"))

# 📈 Plot maken
plt.figure(figsize=(8, 5))
sns.regplot(
    x='TX',
    y='1.2.3 Diefstal van brom-, snor-, fietsen',
    data=df,
    scatter_kws={'alpha': 0.5}
)
plt.xlabel("Maximum Temperature (°C)")
plt.ylabel("Number of Bicycle Thefts")
plt.grid(True)
plt.tight_layout()
plt.show()

Bicycle Theft vs. Maximum Temperature

Slight increase in thefts when it’s warmer.

../_images/cea4217229bb5fd57bd26a2d6c578af1b5db614a9d3a52f189ff49bde732d9b1.png

This scatterplot shows the relationship between monthly maximum temperature (°C) on the horizontal axis and the number of bicycle thefts reported in the Netherlands on the vertical axis. Each point represents one month. The blue regression line indicates a slight upward trend: bicycle thefts do appear to increase when temperatures are higher. Pearson’s correlation between the two is 0.502, which is considered moderate. To put it more intuitively: every single degree that a day gets warmer, an average of 13.23 more bicycles are stolen. This result supports the first argument, since warmer weather seems to mean more bike theft.